const mongoose = require('mongoose');

mongoose.connect('mongodb://127.0.0.1:27017/project');

mongoose.connection.on('error',err=>console.log(err));

mongoose.connection.once('open',()=>{
    console.log('数据库链接成功');
})

module.exports = mongoose;